<%@page import="com.sbl.bajw.pc.model.DeptModel"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@include file="../../common/prama.jsp" %>
<%
	Object obj1 = request.getAttribute("blackDeptModels");
	Object obj2 = request.getAttribute("model");
	String isadd = request.getAttribute("add")+"";
	DeptModel model = null;
	List<DeptModel> blackDepts = null;
	if(obj1 != null){
		blackDepts = (List<DeptModel>)obj1;
	}
	if(obj2 != null){
		model = (DeptModel)obj2;
	}
%>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>边界编辑</title>
<link href="${burl }/css/common/dialog.css" type="text/css" rel="stylesheet"/>
<link href="${burl }/css/common/common.css" type="text/css" rel="stylesheet"/>
<link href="${burl }/css/manager/deptBorderEdit.css" type="text/css" rel="stylesheet"/>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=1.3"></script>
<script type="text/javascript" src="http://api.map.baidu.com/library/DrawingManager/1.4/src/DrawingManager_min.js"></script>
<link rel="stylesheet" href="http://api.map.baidu.com/library/DrawingManager/1.4/src/DrawingManager_min.css" />
<script type='text/javascript' src='<%=burl %>/js/common/jquery/jquery-1.8.2.min.js?null'></script>
<script type='text/javascript' src='<%=burl %>/js/common/common.js'></script>
<script type='text/javascript' src='<%=burl %>/js/common/BaiduMapCommon.js'></script>
<script type="text/javascript" src="<%=burl %>/js/business/modelDao.js"></script>
<script type='text/javascript' src='<%=burl %>/js/business/manager/deptBorderEdit.js'></script>
</head>
<body >
	<div id="bmap"></div>
	<div style="display: none" id="modelDetail">
			<div id="searchDiv" class="CommonPanel" style="border:0">
			<p class="title">基本信息：</p>
				<table>
					<tr>
						<td class="label">部门编号：</td>
						<td class="input">
							<input id="deptcode" name="deptcode" value="${model.id }"/>
						</td>
					</tr>
					<tr>
						<td class="label">部门名称：</td>
						<td class="input">
							<input id="deptname" name="deptname" value="${model.deptname }"/>
						</td>
					</tr>
					<tr>
						<td class="label">部门全称：</td>
						<td class="input">
							<input id="cuscode" name="cuscode" value="${model.cuscode }"/>
						</td>
					</tr>
				</table>
				<p class="title">空间信息：</p>
				<table>
					<tr>
						<td class="label">中心点经度：</td>
						<td class="input">
							<input id="mapx" name="mapx" value="${model.mapx }"/>
						</td>
					</tr>
					<tr>
						<td class="label">中心点纬度：</td>
						<td class="input">
							<input id="mapy" name="mapy" value="${model.mapy }"/>
						</td>
					</tr>
					<tr>
						<td class="label">边界信息：</td>
						<td class="input">
							<input id="mapxy" name="mapxy" value="${model.mapxy }"/>
						</td>
					</tr>
					<tr>
						<td colspan="2" style="text-align: left;">
							<a id="resetCenterPoint" href="#">标注中心点</a>
							&nbsp;&nbsp;
							<%
								if(model.getMapxy()==null || model.getMapxy().equals("")){
									%>
									<a id="drawBtn" start="false" href="#">绘制边界</a>
									<%
								}
								else{
									%>
									<a id="editBorder" start="false" href="#">编辑边界</a>
									<%
								}
							%>
							
						</td>
					</tr>
				</table>
				<%
					if(isadd.equals("add")){
						%>
						<button class="commonBtn" id="submitBtn" style="float: right;padding-bottom: 6px;padding-top: 6px">提交</button>
						<%
					}
					else{
						%>
						<button class="commonBtn" id="saveBtn" style="float: right;padding-bottom: 6px;padding-top: 6px">保存</button>
						<%
					}
				%>
				
				<input type="hidden" id="id" name="id" value="${model.id }"/>
				<input type="hidden" id="pid" name="pid" value="${model.pid }"/>
				<input type="hidden" id="pid" name="pid" value="${model.pid }"/>
				<input type="hidden" id="depttype" name="depttype" value="${model.depttype }"/>
				<input type="hidden" id="fullid" name="fullid" value="${model.fullid }"/>
			</div>
	</div>
	<div id="blackDepts" style="display: none">
		<%
			if(blackDepts != null){
				for(int i=0;i<blackDepts.size();i++){
					String mapxy = blackDepts.get(i).getMapxy();
					%>
					<input name="blackdepts" value="<%=mapxy%>"/>
					<%
				}
			}
		%>
	</div>
</body>
</html>